package com.briup.jd2407cms.web.controller;

import com.briup.jd2407cms.result.Result;
import com.briup.jd2407cms.service.UserService;
import com.briup.jd2407cms.vo.LoginParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @Autowired
    UserService userService;

    @ApiOperation("用户登陆")
    @PostMapping("/login")
    public Result<String> login(@RequestBody LoginParam loginParam){
        return Result.success(userService.login(loginParam));
    }
    @ApiOperation("用户登出")
    @GetMapping("/logout")
    public Result<?> logout(){
        return Result.success();
    }

}
